{% if posts %}
<div class="article-list">
    {% for post in posts %}
    <article class="article-wrap">
        <div class="article-head">
            <a href="/p/{{ post['post_id']}}" title="{{ post['post_descp'] and post['post_descp'] or post['post_title'] }}"><h4>{{ post['post_title'] }}</h4></a>
            <p><small>标签：</small>
            {% if post['post_id'] in ptids %}
            <small>
                {% for term in ptids[post['post_id']] %}
                <a href="/t/{% raw url_escape(ptags[term['term_id']]['term_name']) %}"><span class="label label-success">{{ ptags[term['term_id']]['term_name'] }}</span></a>&nbsp;&nbsp;
                {% end %}
            </small>
            {% else %}
            <small>无</small>
            {% end %}
            </p>
        </div>
        <div class="article-body">
            {% raw post['post_summary'] %}
        </div>
        <div class="article-foot">
            <p>
            {% if post['post_source'].strip() != '' %}<small>来源：{% raw post['post_source'] %}</small>{% end %}
            {% if post['post_author'].strip() != '' and (post['user_id'] not in psers or psers[post['user_id']]['user_name'] != post['post_author']) %}{% if post['post_source'].strip() != '' %}<br>{% end %}<small>作者：{{ post['post_author'] }}</small>{% end %}
            </p>
            <p class="text-right">{% if post['user_id'] in psers %}<a href="/@{{ psers[post['user_id']]['user_name'] }}" target="_blank"><small>{{ psers[post['user_id']]['user_name'] }}</small></a>{% end %}<small> 发布于 {{ handler.timer().strftime('%Y-%m-%d %H:%M', handler.timer().localtime(post['post_ptms'])) }}</small></p>
            <p class="text-right"><a href="/p/{{ post['post_id']}}" title="{{ post['post_descp'] and post['post_descp'] or post['post_title'] }}">全文 &raquo; </a></p>
        </div>
    </article>
    {% end %}
</div>
{% else %}
<div class="alert alert-block text-center">
    <strong>没有发现内容</strong>
</div>
{% end %}

{% module Template("_page.html", pager=pager) %}
